package books.storage.eao;

import java.util.List;

import javax.ejb.Remote;

import books.storage.exception.EntityNotFoundException;
import books.storage.util.jpa.Entity;

@Remote
public interface IBooksStorageEao {

	public void flush();

	public <T extends Entity> T findOrFail(Class<T> clazz, Integer id)
			throws EntityNotFoundException;
	
	public <T extends Entity> void insertEntity(T _entity);

	public <T extends Entity> void deleteEntity(T _entity);

	public <T extends Entity> void updateEntity(T _entity);

	public <T extends Entity> List<T> getAllEntities(Class<T> resultClass);

}